/****** Object:  Table [dbo].[BowlingTest_RecordT]    Script Date: 03/30/2013 19:31:17 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[BowlingTest_RecordT](
	[SEQ] [int] IDENTITY(1,1) NOT NULL,
	[USERID] [varchar](20) NOT NULL,
	[PLAYDATE] [datetime] NOT NULL,
	[ENDDATE] [datetime] NULL,
	[THROW11] [int] NOT NULL,
	[THROW12] [int] NOT NULL,
	[THROW21] [int] NOT NULL,
	[THROW22] [int] NOT NULL,
	[THROW31] [int] NOT NULL,
	[THROW32] [int] NOT NULL,
	[THROW41] [int] NOT NULL,
	[THROW42] [int] NOT NULL,
	[THROW51] [int] NOT NULL,
	[THROW52] [int] NOT NULL,
	[THROW61] [int] NOT NULL,
	[THROW62] [int] NOT NULL,
	[THROW71] [int] NOT NULL,
	[THROW72] [int] NOT NULL,
	[THROW81] [int] NOT NULL,
	[THROW82] [int] NOT NULL,
	[THROW91] [int] NOT NULL,
	[THROW92] [int] NOT NULL,
	[THROW101] [int] NOT NULL,
	[THROW102] [int] NOT NULL,
	[THROW103] [int] NOT NULL,
	[SCORE1] [int] NOT NULL,
	[SCORE2] [int] NOT NULL,
	[SCORE3] [int] NOT NULL,
	[SCORE4] [int] NOT NULL,
	[SCORE5] [int] NOT NULL,
	[SCORE6] [int] NOT NULL,
	[SCORE7] [int] NOT NULL,
	[SCORE8] [int] NOT NULL,
	[SCORE9] [int] NOT NULL,
	[SCORE10] [int] NOT NULL,
	[LAST_FRAME_NO] [int] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[PLAYDATE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ('NO ID') FOR [USERID]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW11]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW12]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW21]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW22]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW31]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW32]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW41]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW42]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW51]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW52]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW61]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW62]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW71]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW72]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW81]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW82]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW91]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW92]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW101]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW102]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [THROW103]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE1]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE2]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE3]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE4]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE5]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE6]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE7]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE8]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE9]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((0)) FOR [SCORE10]
GO

ALTER TABLE [dbo].[BowlingTest_RecordT] ADD  DEFAULT ((1)) FOR [LAST_FRAME_NO]
GO


GO

/****** Object:  Table [dbo].[BowlingTest_SetScoreT]    Script Date: 03/30/2013 19:31:25 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[BowlingTest_SetScoreT](
	[FRAME_NO] [int] NOT NULL,
	[THROW1] [int] NOT NULL,
	[THROW2] [int] NOT NULL,
	[THROW3] [int] NULL,
	[SCORE] [int] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[FRAME_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[BowlingTest_SetScoreT] ADD  DEFAULT ((-1)) FOR [THROW1]
GO

ALTER TABLE [dbo].[BowlingTest_SetScoreT] ADD  DEFAULT ((-1)) FOR [THROW2]
GO

ALTER TABLE [dbo].[BowlingTest_SetScoreT] ADD  DEFAULT ((-1)) FOR [SCORE]
GO


/****** Object:  Table [dbo].[BowlingTest_UserT]    Script Date: 03/30/2013 19:31:29 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[BowlingTest_UserT](
	[SEQ] [int] IDENTITY(1,1) NOT NULL,
	[USERID] [varchar](20) NOT NULL,
	[USERNAME] [varchar](20) NOT NULL,
	[PSWORD] [varchar](10) NOT NULL,
	[AVERAGE] [int] NULL,
PRIMARY KEY CLUSTERED 
(
	[USERID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO
